<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>exception_ptr_rethrow&lt;T, EC, EP&gt; - Boost.Outcome documentation</title>
<link rel="stylesheet" href="../../css/boost.css" type="text/css">
<meta name="generator" content="Hugo 0.52 with Boostdoc theme">
<meta name="viewport" content="width=device-width,initial-scale=1.0"/>

<link rel="icon" href="../../images/favicon.ico" type="image/ico"/>
<body><div class="spirit-nav">
<a accesskey="p" href="../../reference/policies/error_code_throw_as_system_error_result.html"><img src="../../images/prev.png" alt="Prev"></a>
    <a accesskey="u" href="../../reference/policies.html"><img src="../../images/up.png" alt="Up"></a>
    <a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../../reference/policies/exception_ptr_rethrow_result.html"><img src="../../images/next.png" alt="Next"></a></div><div id="content">
  <div class="titlepage"><div><div><h1 style="clear: both"><code>exception_ptr_rethrow&lt;T, EC, EP&gt;</code></h1></div></div></div>
  <p><em>Note</em>: This policy class specialisation can only be used with <code>basic_outcome</code>, not <code>basic_result</code>. Use <a href="../../reference/policies/exception_ptr_rethrow_result.html" class="api-reference"><code>exception_ptr_rethrow&lt;T, EC, void&gt;</code></a>
 with <code>basic_result</code>.</p>

<p>Policy class defining that the ADL discovered free function <code>rethrow_exception(impl.assume_exception())</code> if possible, followed by <code>rethrow_exception(impl.assume_error())</code> should be called on incorrect wide value observation. Generally this will ADL discover 
<a href="https://en.cppreference.com/w/cpp/error/rethrow_exception" class="api-reference" target="_blank"><i class="fa fa-book" aria-hidden="true"></i> <code>std::rethrow_exception()</code></a>
 or <code>boost::rethrow_exception()</code> depending on the <code>EC</code> type.</p>

<p>Incorrect wide error observation performs:</p>
<div class="highlight"><pre class="chroma"><code class="language-c++" data-lang="c++"><span class="n">BOOST_OUTCOME_THROW_EXCEPTION</span><span class="p">(</span><span class="n">bad_outcome_access</span><span class="p">(</span><span class="s">&#34;no error&#34;</span><span class="p">));</span>
</code></pre></div>
<p>Incorrect wide exception observation performs:</p>
<div class="highlight"><pre class="chroma"><code class="language-c++" data-lang="c++"><span class="n">BOOST_OUTCOME_THROW_EXCEPTION</span><span class="p">(</span><span class="n">bad_outcome_access</span><span class="p">(</span><span class="s">&#34;no exception&#34;</span><span class="p">));</span>
</code></pre></div>
<p>Inherits publicly from <a href="../../reference/policies/base.html" class="api-reference"><code>base</code></a>
, and its narrow value, error and exception observer policies are inherited from there.</p>

<p><em>Requires</em>: Nothing.</p>

<p><em>Namespace</em>: <code>BOOST_OUTCOME_V2_NAMESPACE::policy</code></p>

<p><em>Header</em>: <code>&lt;boost/outcome/policy/outcome_exception_ptr_rethrow.hpp&gt;</code></p>


        </div><p><small>Last revised: February 01, 2019 at 23:42:52 UTC</small></p>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../../reference/policies/error_code_throw_as_system_error_result.html"><img src="../../images/prev.png" alt="Prev"></a>
    <a accesskey="u" href="../../reference/policies.html"><img src="../../images/up.png" alt="Up"></a>
    <a accesskey="h" href="../../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="../../reference/policies/exception_ptr_rethrow_result.html"><img src="../../images/next.png" alt="Next"></a></div></body>
</html>
